/// <reference path="../../../../typings/index.d.ts" />
import util from '../../../common/js/util'
import NProgress from 'nprogress'
import axios from 'axios';
import address from "../../../../models/dict/address.js"  //任务字典模块
import moment from 'moment'

import task from "../../../../models/dict/task.js"  //任务字典模块
import array from "../../../../models/comm/array.js"  //数组操作模块
import yz from "../../../../models/comm/yz.js"  //数组操作模块
import Vue from 'vue'

import math from 'mathjs';




export default {
    data() {
        return {



            unitArray: task.unitArray(),

            listLoading: false,
            amount: 0



        }
    },
    methods: {


        addDetail() {

            this.currObj.detail.push({
                id: moment().utcOffset(-8).format("YYMMDDHHmmssSSS"),
                menfu: 0,
                num: 0,
                unitId: "",
                price: 0,
                amount: 0,
                taskClassId: this.currObj.taskClassId
            })

            var i = 1;

            var q = math.chain(5).divide(3).round(2);


            console.log(q.value);
        },

        fmtTask: function () {


            task.fmtTask(this.currObj);
        },
        delDetal(row, index) {


            this.currObj.detail.splice(index, 1);
        }
     




    },
    props: {
        currObj: {

        }


    }
}